package com.atguigu.springcloud.service.impl;

import com.atguigu.springcloud.dao.PaymentDao;
import com.atguigu.springcloud.entities.Payment;
import com.atguigu.springcloud.service.PaymentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 支付操作业务实现类
 *
 * @author XiongJL
 * @date 2021/6/16 9:19
 **/
@Service
public class PaymentServiceImpl implements PaymentService {
    /**
     * @Resource 是 Java自带的。
     * @Autowired 是 Spring 的。
     */
    @Resource
    private PaymentDao paymentDao;


    @Override
    public int create(Payment payment) {
        return paymentDao.insert(payment);
    }

    @Override
    public Payment getPaymentById(Long id) {
        return paymentDao.selectById(id);
    }
}
